<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>embedme: libemb::Coroutine Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>libemb</b></li><li class="navelem"><a class="el" href="classlibemb_1_1_coroutine.html">Coroutine</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classlibemb_1_1_coroutine-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">libemb::Coroutine Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>协程类  
 <a href="classlibemb_1_1_coroutine.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="_coroutine_8h_source.html">Coroutine.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aecbf19687671f4c46bf0111babccdb34"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_coroutine.html#aecbf19687671f4c46bf0111babccdb34">routine</a> ()=0</td></tr>
<tr class="memdesc:aecbf19687671f4c46bf0111babccdb34"><td class="mdescLeft">&#160;</td><td class="mdescRight">协程运行体  <a href="classlibemb_1_1_coroutine.html#aecbf19687671f4c46bf0111babccdb34">More...</a><br /></td></tr>
<tr class="separator:aecbf19687671f4c46bf0111babccdb34"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a72d2ee817d81859543ef326983471ddb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_coroutine.html#a72d2ee817d81859543ef326983471ddb">coroutineID</a> ()</td></tr>
<tr class="memdesc:a72d2ee817d81859543ef326983471ddb"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取协程ID  <a href="classlibemb_1_1_coroutine.html#a72d2ee817d81859543ef326983471ddb">More...</a><br /></td></tr>
<tr class="separator:a72d2ee817d81859543ef326983471ddb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae2e9d6c4aace1bb2cdf2f82d09c6d4c4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_coroutine_8h.html#a3f4fad34f91591dfbdf668a6ee38aa94">CoroutineState</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_coroutine.html#ae2e9d6c4aace1bb2cdf2f82d09c6d4c4">state</a> ()</td></tr>
<tr class="memdesc:ae2e9d6c4aace1bb2cdf2f82d09c6d4c4"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取协程状态  <a href="classlibemb_1_1_coroutine.html#ae2e9d6c4aace1bb2cdf2f82d09c6d4c4">More...</a><br /></td></tr>
<tr class="separator:ae2e9d6c4aace1bb2cdf2f82d09c6d4c4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bc4de04653687fc239ace0d15661992"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_coroutine.html#a1bc4de04653687fc239ace0d15661992">usleep</a> (int us)</td></tr>
<tr class="memdesc:a1bc4de04653687fc239ace0d15661992"><td class="mdescLeft">&#160;</td><td class="mdescRight">微妙级休眠  <a href="classlibemb_1_1_coroutine.html#a1bc4de04653687fc239ace0d15661992">More...</a><br /></td></tr>
<tr class="separator:a1bc4de04653687fc239ace0d15661992"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a047ac6774fb263066f3bdf54230d5437"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_coroutine.html#a047ac6774fb263066f3bdf54230d5437">msleep</a> (int ms)</td></tr>
<tr class="memdesc:a047ac6774fb263066f3bdf54230d5437"><td class="mdescLeft">&#160;</td><td class="mdescRight">毫秒级休眠  <a href="classlibemb_1_1_coroutine.html#a047ac6774fb263066f3bdf54230d5437">More...</a><br /></td></tr>
<tr class="separator:a047ac6774fb263066f3bdf54230d5437"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1b79e5fbd51800e261a03e66fa67fb37"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classlibemb_1_1_coroutine.html#a1b79e5fbd51800e261a03e66fa67fb37">isRunning</a> ()</td></tr>
<tr class="memdesc:a1b79e5fbd51800e261a03e66fa67fb37"><td class="mdescLeft">&#160;</td><td class="mdescRight">判断协程是否正在运行  <a href="classlibemb_1_1_coroutine.html#a1b79e5fbd51800e261a03e66fa67fb37">More...</a><br /></td></tr>
<tr class="separator:a1b79e5fbd51800e261a03e66fa67fb37"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a47b0112bc2c87e007ab641b35fbbb273"><td class="memItemLeft" align="right" valign="top"><a id="a47b0112bc2c87e007ab641b35fbbb273"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>resume</b> ()</td></tr>
<tr class="separator:a47b0112bc2c87e007ab641b35fbbb273"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a55ce7d793c49140d981b89ec832fb10d"><td class="memItemLeft" align="right" valign="top"><a id="a55ce7d793c49140d981b89ec832fb10d"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>yield</b> ()</td></tr>
<tr class="separator:a55ce7d793c49140d981b89ec832fb10d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a36dbf000adccf870b406d2327d991ac3"><td class="memItemLeft" align="right" valign="top"><a id="a36dbf000adccf870b406d2327d991ac3"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>CoScheduler</b></td></tr>
<tr class="separator:a36dbf000adccf870b406d2327d991ac3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>协程类 </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a72d2ee817d81859543ef326983471ddb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a72d2ee817d81859543ef326983471ddb">&#9670;&nbsp;</a></span>coroutineID()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int libemb::Coroutine::coroutineID </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取协程ID </p>
<dl class="section return"><dt>Returns</dt><dd>int </dd></dl>

</div>
</div>
<a id="a1b79e5fbd51800e261a03e66fa67fb37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b79e5fbd51800e261a03e66fa67fb37">&#9670;&nbsp;</a></span>isRunning()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool libemb::Coroutine::isRunning </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>判断协程是否正在运行 </p>
<dl class="section return"><dt>Returns</dt><dd>true </dd>
<dd>
false </dd></dl>

</div>
</div>
<a id="a047ac6774fb263066f3bdf54230d5437"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a047ac6774fb263066f3bdf54230d5437">&#9670;&nbsp;</a></span>msleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void libemb::Coroutine::msleep </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>ms</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>毫秒级休眠 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">ms</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aecbf19687671f4c46bf0111babccdb34"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aecbf19687671f4c46bf0111babccdb34">&#9670;&nbsp;</a></span>routine()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void libemb::Coroutine::routine </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>协程运行体 </p>
<dl class="section note"><dt>Note</dt><dd>子类需实现该方法 </dd></dl>

</div>
</div>
<a id="ae2e9d6c4aace1bb2cdf2f82d09c6d4c4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae2e9d6c4aace1bb2cdf2f82d09c6d4c4">&#9670;&nbsp;</a></span>state()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="_coroutine_8h.html#a3f4fad34f91591dfbdf668a6ee38aa94">CoroutineState</a> libemb::Coroutine::state </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取协程状态 </p>
<dl class="section return"><dt>Returns</dt><dd>CoroutineState </dd></dl>

</div>
</div>
<a id="a1bc4de04653687fc239ace0d15661992"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1bc4de04653687fc239ace0d15661992">&#9670;&nbsp;</a></span>usleep()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void libemb::Coroutine::usleep </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>us</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>微妙级休眠 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">us</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="_coroutine_8h_source.html">Coroutine.h</a></li>
<li>src/Coroutine.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>
